﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Model.Sec
{
    /// <summary>
    /// 登录日志类，日志存在数据库SEC_LOGONLOG表中
    /// </summary>
    public class LogonLog
    {
        /// <summary>
        /// 登录日志类构造函数
        /// </summary>
        public LogonLog()
        {
            string LogISN;
            LogISN = DateTime.Now.ToString("yyyyMMddhhssmm");
            Random rd = new Random();
            LogISN = LogISN + rd.Next(0, 999);
            this._LogISN = LogISN;
            this.LogonTime = DateTime.Now;
        }

        #region Log的属性
        private string _LogISN;
        /// <summary>
        /// 日志序号
        /// </summary>
        public string LogISN
        {
            get { return _LogISN; }
            set { this._LogISN = value;}
        }

        private string _UserISN;
        /// <summary>
        /// 登录用户ID
        /// </summary>
        public string UserISN
        {
            get { return _UserISN; }
            set { _UserISN = value; }
        }

        private string _UserName;
        /// <summary>
        /// 用户名称
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }

        private string _UserIP;
        /// <summary>
        /// 登录用户IP
        /// </summary>
        public string UserIP
        {
            get { return _UserIP; }
            set { _UserIP = value; }
        }

        private string _UserMAC;
        /// <summary>
        /// 登录用户MAC
        /// </summary>
        public string UserMAC
        {
            get { return _UserMAC; }
            set { _UserMAC = value; }
        }

        private DateTime _LogonTime;
        /// <summary>
        /// 登入时间
        /// </summary>
        public DateTime LogonTime
        {
            get { return _LogonTime; }
            set { _LogonTime = value; }
        }

        private DateTime _LogoutTime;
        /// <summary>
        /// 登出时间
        /// </summary>
        public DateTime LogoutTime
        {
            get { return _LogoutTime; }
            set { _LogoutTime = value; }
        }

        private string _LogonSucceed;
        /// <summary>
        /// 是否成功,这是一个状态值。0：成功，-1：用户名不存在，-2：密码错误，-3：IP或MAC地址被限制
        /// </summary>
        public string LogonSucceed
        {
            get { return _LogonSucceed; }
            set { _LogonSucceed = value; }
        }

        #endregion
    }
}
